<?php

	//To change the arrival time of the order
	$orderNum = $_POST['orderNum'];
	$arrivalTime = $_POST['time'];
	
	// $orderNum = "AM2013-11-13-09-33-44";
	// $arrivalTime = "2013-11-22 01:01:10";
	
	$con = mysqli_connect('localhost','root','','cs2102') or die("fail");
	if(mysqli_connect_errno($con))
	{
		echo "error";
	}
	else
	{
		$query = "UPDATE orders SET arrivalTime = \"$arrivalTime\" where orderNum = \"$orderNum\" ";
		
		if(mysqli_query($con,$query)){
			echo "Success";
			}
		else{
			echo "Fail";
		}
	}
	
	mysqli_close($con);
?>